<!DOCTYPE html>
<html lang="en">

<head>

</head>

<body>
    <div id="wrapper">
        <ol class="breadcrumb">
            <li><a href="javascript:void(0)">首页管理</a>
            </li>
            <li class="active">产品推荐</li>
        </ol>
        <div class="form-inline">
            <div class="form-group">
                <label for="tisid">产品分类</label>
                <select id="tisid" class="form-control"  style="width:150px;" onchange="categoryChg()"></select>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">

                <div class="panel panel-default">
                    <div class="panel-heading">
                        信息列表
                        <button type="button" onclick="onAddClick()" class="btn btn-default">新建</button>
                    </div>
                    <!-- /.panel-heading -->
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th>产品ID</th>
                                    <th>产品简介</th>
                                    <th>销量</th>
                                    <th>所在城市</th>
                                    <th>排序</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody id="indexGoods-placeholder">
                                </tbody>
                            </table>
                        </div>
                        <!-- /.table-responsive -->
                        <div class="center-block" style="width: 350px">
                            <ul id="paginator"></ul>
                        </div>
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
        </div>
    </div>

    <div id="userModal" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                    </button>
                    <h4 class="modal-title">用户</h4>
                </div>
                <div class="modal-body">
                    <div class="form-horizontal" id="user_form">
                        <div class="form-group">
                            <label for="goodsurl" class="col-sm-2 control-label">产品ID</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="goodsurl" check-type="required">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="type_id" class="col-sm-2 control-label">产品类别</label>
                            <div class="col-sm-9">
                                <select id="type_id" class="form-control"  style="width:150px;"></select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="buycount" class="col-sm-2 control-label">销量</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="buycount" check-type="required">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="city_id" class="col-sm-2 control-label">所在城市</label>
                            <div class="col-sm-9">
                                <select id="city_id" class="form-control"  style="width:150px;">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="order_id" class="col-sm-2 control-label">排序</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="order_id" check-type="required">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer"><input type="text" id="id" style="display:none;"/>
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button onclick="onSaveClick()" type="button" class="btn btn-primary" id="user_buttonid">保存</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>

    <script id="indexGoods-template" type="text/x-handlebars-template">
        {{#datas}}
        <tr>
            <td>{{math @index "idx" 1}}</td>
            <td>{{goodsurl}}</td>
            <td>{{info}}</td>
            <td>{{buycount}}</td>
            <td>{{city_name}}</td>
            <td>{{order_id}}</td>
            <td>
                <button class="btn-link" onclick="onUpdateClick('{{id}}')">修改</button>
                <button class="btn-link" onclick="onDeleteClick('{{id}}')">删除</button>
            </td>
        </tr>
        {{/datas}}
    </script>

    <script type="text/javascript" src="../js/indexPage/indexGoods.js"></script>
</body>

</html>
